<?php


    require 'db_con.php';
    $username=$_REQUEST['username'];
    $content=$_REQUEST['content'];
    date_default_timezone_set('PRC');
    $wdate=date("Y-m-d G:i:s");//时区
    $sql="insert into tb_wish(username,content,wdate) values('{$username}','{$content}','{$wdate}');";
    //echo $sql; 、检查错误
    //die();
    $rs=$db->query($sql);
    $id=mysqli_insert_id($db);
    $db->close();
    if ($rs==true)
    {
        $rdata=array("msg"=>1,"username"=>$username,"content"=>$content,"wdate"=>$wdate,"id"=>$id);
        echo json_encode($rdata);
    }
    else
    {
        $rdata=array("msg"=>0);
        echo json_encode($rdata);
    }